<html>
<head><meta charset="utf-8"><title>collector + check mode · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html">collector + check mode</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="158994456"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/158994456" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#158994456">(Feb 20 2019 at 17:22)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> is there a single scenario where invoking a collector in check mode is a correct course of action?</p>



<a name="158994510"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/158994510" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#158994510">(Feb 20 2019 at 17:23)</a>:</h4>
<p>I figure that in case there isn't one it would make sense to add the condition inside the collector query.</p>



<a name="159084725"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159084725" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159084725">(Feb 21 2019 at 16:57)</a>:</h4>
<p>@mw ping.</p>



<a name="159084740"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159084740" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159084740">(Feb 21 2019 at 16:57)</a>:</h4>
<p><span class="user-mention" data-user-id="124287">@mw</span> do you have any idea why cargo check would end up invoking the full codegen?</p>



<a name="159084790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159084790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159084790">(Feb 21 2019 at 16:58)</a>:</h4>
<p>I had hoped that fixing metadata generation code to not use the optimising context would work.</p>



<a name="159084801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159084801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159084801">(Feb 21 2019 at 16:58)</a>:</h4>
<p>but now it is invoking the regular one...</p>



<a name="159085174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085174">(Feb 21 2019 at 17:02)</a>:</h4>
<p>but this in general goes against my intuition about what cargo check ought to be doing</p>



<a name="159085180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085180">(Feb 21 2019 at 17:02)</a>:</h4>
<p>I think it basically uses the existing pipeline to pack the metadata into the rlib</p>



<a name="159085182"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085182" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085182">(Feb 21 2019 at 17:02)</a>:</h4>
<p>(i.e. generate metadata and quit)</p>



<a name="159085244"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085244" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085244">(Feb 21 2019 at 17:03)</a>:</h4>
<p>you should be able to just add an early exit in the query provider</p>



<a name="159085305"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085305" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085305">(Feb 21 2019 at 17:04)</a>:</h4>
<p>doing the same check as the metadata encoder does</p>



<a name="159085316"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085316" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085316">(Feb 21 2019 at 17:04)</a>:</h4>
<p>but I agree that this isn't the cleanest setup</p>



<a name="159085450"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085450" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085450">(Feb 21 2019 at 17:06)</a>:</h4>
<p>yaeh so I was wondering, why not add such an early exit to the partition query in the first place.</p>



<a name="159085481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085481">(Feb 21 2019 at 17:07)</a>:</h4>
<p>it seems fine for me for partitioner to return an empty set of CUs when it knows that it would fail collecting either way</p>



<a name="159085603"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159085603" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159085603">(Feb 21 2019 at 17:08)</a>:</h4>
<p>for now I’ll just make sure that non-optimising context is used in ssa backend as well</p>



<a name="159138750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159138750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159138750">(Feb 22 2019 at 08:05)</a>:</h4>
<p>It's a bit tricky. Technically we don't know that it will fail. We know the current build is only producing metadata data but upstream crates might have been compiled the regular way in which case everything would work fine.</p>



<a name="159138805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/collector%20%2B%20check%20mode/near/159138805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mw <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/collector.20.2B.20check.20mode.html#159138805">(Feb 22 2019 at 08:06)</a>:</h4>
<p>in practice this does not usually occur</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>